
$(document).ready( function () {
				var oTable = $('#user_data_table_id').dataTable( {
					"bJQueryUI": true,
					"sPaginationType": "full_numbers",
					"sDom": '<"H"CTflr>t<"F"ip>',
					"bStateSave": false,
					"iDisplayLength": 25,
				    "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], 
				    "oLanguage": {
			            "sSearch": "Search all columns:"
			        },
			        "aoColumnDefs": [ 
			                        
			                           { "sClass": "centerCust", "aTargets": [ 3 ] }
			                       ],
	                                    
					"oTableTools": {
						"aButtons": [
							/*"copy", "csv", "xls", "pdf","print",*/
							
							{
								"sExtends": "copy",
								"sButtonText": "Copy to clipboard"
							},
							/*{
								"sExtends": "csv",
								"sButtonText": "CSV"
							},*/
							{
								"sExtends": "xls",
								"sButtonText": "Excel"
							},
							{
								"sExtends": "pdf",
								"sButtonText": "PDF"
							},
							{
								"sExtends": "print",
								"sButtonText": "Print View"
							}
														/*,"xls",
							{
								"sExtends":    "collection",
								"sButtonText": "Save",
								"aButtons":    [ "csv", "xls", "pdf" ]
							}*/
						]
					}
				} );
				

				$("#user_data_table_id tr").hover(
						  function () {
						    $(this).css("background","#CCCC99").css("cursor","pointer");
						  }, 
						  function () {
						    $(this).css("background","");
						  }
						);
				 $("select").change(function(){
					 $("#user_data_table_id tr").hover(
							  function () {
							    $(this).css("background","#CCCC99").css("cursor","pointer");
							  }, 
							  function () {
							    $(this).css("background","");
							  }
							);
				    });
				 

					 
					 $("a[rel^='prettyPopin']:eq(0)").prettyPopin({width: 550,followScroll:false});
					 $("a[rel^='prettyPopin']:eq(1)").prettyPopin({width: 550,followScroll:false});
					
			} );
			
			$(function() {
				$( "input:submit, a, input:button", ".demo" ).button();
				
			});
			 
				
				function rowSelect(obj) {
					
					 if(!($(obj).hasClass("select_edit"))){
						 $("#edit").attr("href","");
					 $("tr.select_edit").attr("style","background: !important");
					 $("tr.select_edit").removeClass("select_edit");
					 $(obj).attr("style","background:#94B52C!important");
					 $(obj).addClass("select_edit");
					 $("#edit span").text("Edit");
					 $("#edit").attr("href","UserRegistrationAction.do?id="+$("tr.select_edit span.hide_").html()+"&pType="+$("#edit span").html());
					 }else{
						 $("tr.select_edit").attr("style","background: !important");
						 $("tr.select_edit").removeClass("select_edit");
						 $("#edit").attr("href","UserRegistrationAction.do?pType=New");
						 $("#edit span").text("New");
					 }
				 }
				
				function deleteRec(){
						try{
								if($("tr.select_edit span.hide_").html()!=null){
									if(confirm("Do you really want to delete record ?")){
										$("form").attr("action", "UserRegAction.html?id="+$("tr.select_edit span.hide_").html()+"&pType=Delete");
										$("form").submit();
									}
								}else{alert("Please select a record!!!");}
							}catch(e){
								
							}
						
				}
				
